package com.yingoo.controller;

import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Created by admin on 2017/8/4.
 */
public class MyUtil {
    public static List<String> getBookNamesByMark(String txt) {
        Pattern  pattern = Pattern.compile("《.*?》");
        Matcher match = pattern.matcher(txt);
        List<String> bookNames = new ArrayList<>();
        while (match.find()) {
            if(match.group().length()<45&&!bookNames.contains(match.group()))
                bookNames.add(match.group());
        }
        return bookNames;
    }

}
